﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace TXTD.Admin.Data.Migrations
{
    public partial class _202207161 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "SYS_CONFIG",
                columns: table => new
                {
                    CONFIG_ID = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false),
                    CONFIG_NAME = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
                    CONFIG_KEY_CODE = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
                    CONFIG_KEY_VALUE = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false),
                    CREATED_BY = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false),
                    CREATED_TIME = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UPDATED_BY = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true),
                    UPDATED_TIME = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SYS_CONFIG", x => x.CONFIG_ID);
                });

            migrationBuilder.CreateTable(
                name: "SYS_DICTIONARY",
                columns: table => new
                {
                    DICTIONARY_ID = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false),
                    DICT_CODE = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
                    DICT_NAME = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
                    CREATED_BY = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false),
                    CREATED_TIME = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UPDATED_BY = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true),
                    UPDATED_TIME = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SYS_DICTIONARY", x => x.DICTIONARY_ID);
                });

            migrationBuilder.CreateTable(
                name: "SYS_DICTIONARY_ITEMS",
                columns: table => new
                {
                    DICTIONARY_ITEM_ID = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false),
                    DICTIONARY_ID = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false),
                    ITEM_KEY_CODE = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
                    ITEM_KEY_VALUE = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
                    ENABLED = table.Column<bool>(type: "bit", nullable: false),
                    ITEM_SORT = table.Column<int>(type: "int", nullable: false),
                    CREATED_BY = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false),
                    CREATED_TIME = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UPDATED_BY = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true),
                    UPDATED_TIME = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SYS_DICTIONARY_ITEMS", x => x.DICTIONARY_ITEM_ID);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "SYS_CONFIG");

            migrationBuilder.DropTable(
                name: "SYS_DICTIONARY");

            migrationBuilder.DropTable(
                name: "SYS_DICTIONARY_ITEMS");
        }
    }
}
